using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProjectCastamere
{
    struct GridCell
    {
        private Tower tower;

        /// <summary>
        /// determines whether towers can be placed in this cell and whether
        /// enemies can walk on it
        /// </summary>
        private bool towersCanBePlaced;

        public bool TowersCanBePlaced
        {
            set { towersCanBePlaced = value; }
            get { return towersCanBePlaced; }
        }

        /// <summary>
        /// determines whether an enemy can walk along this grid cell
        /// or whether it is currently occupied by a tower
        /// </summary>
        /// <returns></returns>
        public bool IsWalkable()
        {
            // if there is no tower then the enemy can walk here
            return towersCanBePlaced && tower == null;
        }

        public void SetTower(Tower tower)
        {
            this.tower = tower;
        }
    }
}
